//class 关键字

// function Person(name){
//     this.name = name
// }

// Person.prototype.say = function (){
//      console.log(`hi my name is ${this.name}`)
// }

// let p = new Person("tom")

// p.say()

class Person{
    constructor(name){
       this.name = name
    }

    say(){
        console.log(`hi my name is ${this.name}`)
    }
}

let p = new Person("jack")
p.say()